import 'package:shared_preferences/shared_preferences.dart';

class UserUtils {
  Future<double> getFontSize() async {
    SharedPreferences prefs = await SharedPreferences.getInstance();
    return prefs.getDouble('FONTSIZE') ?? 20;
  }

  Future<int> getBackgroundColor() async {
    SharedPreferences prefs = await SharedPreferences.getInstance();
    return prefs.getInt('BACKGROUNDCOLOR') ?? 0xffF0E68C;
  }

  Future<int> getTextColor()async{
    SharedPreferences prefs = await SharedPreferences.getInstance();
    return prefs.getInt("TEXTCOLOR") ?? 0xff000000;
  }

  setFontSize(double fontSize) async{
    SharedPreferences prefs = await SharedPreferences.getInstance();
    await prefs.setDouble("FONTSIZE", fontSize);
  }

  setBackgroundColor(int color) async {
    SharedPreferences prefs = await SharedPreferences.getInstance();
    await prefs.setInt("BACKGROUNDCOLOR", color);
  }

  setTextColor(int color)async{
    SharedPreferences prefs = await SharedPreferences.getInstance();
    await prefs.setInt("TEXTCOLOR", color);
  }

}
